package com.hankol.community.adapter

import com.baselibrary.bean.WikiHomeAmusingMoreRespWiki
import com.baselibrary.bean.WikiHomeRespWiki
import com.baselibrary.extension.checkValue
import com.baselibrary.extension.load
import com.baselibrary.utils.GlideUtils
import com.baselibrary.view.CircleImageView
import com.baselibrary.view.RoundCornerImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.community.R


/**广场--百科
 *@author:hanke
 *2022/3/30
 *desc:
 */
class SquareWikiAdapter : BaseQuickAdapter<WikiHomeAmusingMoreRespWiki.DataBean, BaseViewHolder>(R.layout.item_square_wiki) {

    override fun convert(helper: BaseViewHolder, item: WikiHomeAmusingMoreRespWiki.DataBean) {
        GlideUtils.loadImg_101(mContext,item.banner.checkValue(),helper.getView<RoundCornerImageView>(R.id.riv_cover))
        helper.setText(R.id.tv_title, item.title.checkValue()).setText(R.id.tv_nick, item.authorName.checkValue())
        GlideUtils.loadImg_101(mContext,item.authorIcon.checkValue(),helper.getView<CircleImageView>(R.id.civ_head))
    }
}